﻿@model IEnumerable<Sysgeprava.Entities.BOVINO>
@using GridMvc.Html

    <link href="@Url.Content("~/Content/Gridmvc.css")" rel="stylesheet" />
    <link href="@Url.Content("~/Content/desing.css")" rel="stylesheet" />
    <link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" />
    <script src="@Url.Content("~/Scripts/jquery-1.9.1.min.js")"></script>
    <script src="@Url.Content("~/Scripts/gridmvc.min.js")"></script>

@{
    ViewBag.Title = "BOVINO";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="float-center" id="panel_titulo">
   <img src="~/Images/titulos/bovino.png" alt="bovino" height="70" width="400"/>
</div>

<h2></h2>

<div style="width:1000px;">
    @helper Acciones(int id)
        {
         <a href="@Url.Action("Edit", "Bovino", new { Id = id })" >
            <img src="@Url.Content("~/Images/edit.png")" title="Editar" /></a> 
         <a href="@Url.Action("Details", "Bovino", new { Id = id })" >
            <img src="@Url.Content("~/Images/delete.png")" title="Eliminar" /></a> 
         <a href="#openModal" >
            <img src="@Url.Content("~/Images/detail.png")" title="Detalle" /></a> 
            
         <div id="openModal" class="modalDialog">
            <div>	<a href="#close" title="Cerrar" class="close">X</a>
                <iframe src="@Url.Action("Details", "Bovino", new { Id = id })" width=900 height=600 style="border:hidden; width:100%;margin:auto; padding:55px;"></iframe>
            </div>
        </div>
        }


    @Html.Grid(Model).Columns(columns =>
        {
            columns.Add(pee => pee.NroArete).Titled("N° Arete").Filterable(true).SetWidth(330);
            columns.Add(pee => pee.Nombre).Titled("Nombre").Filterable(true).SetWidth(400);
            columns.Add(pee => pee.RAZA.Descripcion).Titled("Raza").Filterable(true).SetWidth(400);
            columns.Add(pee => pee.SEXO.Descripcion).Titled("Sexo").Filterable(true).SetWidth(400);
            columns.Add(pee => pee.ETAPA.Descripcion).Titled("Etapa").Filterable(true).SetWidth(300);
            columns.Add(pee => pee.FecNac).Titled("Fec Nacimiento").SetWidth(330).Format("{0:dd/MM/yyyy}");
            columns.Add(o => o.Id)
                .Titled("Acciones")
                .Sanitized(false)
                .Encoded(false)
                .SetWidth(150)
                .RenderValueAs(o => Acciones(o.Id).ToHtmlString());
        }).WithPaging(5)
    

</div>

<p>
    <button onclick="location.href='@Url.Action("Create")';return false;" ><img src="~/Images/botones/file_add.png" title="Nuevo" ></button>
</p>
